package com.lan.lexer.type;

import com.lan.lexer.TokenType;

public enum OptType implements TokenType {

    ASSIGN("=", 2),

    GT(">", 2),

    LT("<", 2),

    NOT("!", 1),

    QUESTION("?", 0),

    COLON(":", 0),

    EQUAL("==", 2),

    LE("<=", 2),

    GE(">=", 2),

    NOTEQUAL("!=", 2),

    AND("&&", 2),

    OR("||", 2),

    INC("++", 1),

    DEC("--", 1),

    ADD("+", 2),

    SUB("-", 2),

    MUL("*", 2),

    DIV("/", 2),

    MOD("%", 2),

    ADD_ASSIGN("+=", 2),
    SUB_ASSIGN("-=", 2),
    MUL_ASSIGN("*=", 2),
    DIV_ASSIGN("/=", 2),
    MOD_ASSIGN("%=", 2);

    private String name;
    private int arity;


    OptType(String name, int arity) {
        this.name = name;
        this.arity = arity;
    }

    @Override
    public String getName() {
        return name;
    }

    public int getArity() {
        return arity;
    }
}
